Git Product home page Git Product logo

colonyjs's Introduction

🎪 Colony TypeScript libraries

Discord

The Colony TypeScript libraries

We are providing the following packages in this monorepo:

  • @colony/sdk - The development kit to build on top of Colony
  • @colony/colony-js - The Colony TypeScript reference implementation
  • @colony/core - Shared utilities, types and constants for all Colony TypeScript libraries
  • @colony/contractor - A nifty tool that creates Colony Network TypeScript bindings
  • @colony/events - All Colony event types in one! Parse and serialize Colony event metadata
  • @colony/tokens - Pre-built Colony token contract bindings

Developing

To start development on any of the included libraries, make sure you have Node v16.x and pnpm v8.x installed.

Run pnpm run bootstrap first

To install all required dependencies run pnpm run bootstrap (this is important!) the first time, later you can just do pnpm install --frozen-lockfile in the root directory of the repository.

You can run pnpm lint, pnpm typecheck, pnpm test and pnpm build in the root directory (will build all packages) or in the individual package directories.

Please make sure to include a changeset when submitting a PR.

Creating a main release

colonyJS is using changesets to create releases. Here's the workflow:

  1. Create a PR and add a changeset within the PR
  2. Have the PR reviewed and merged into main
  3. changesets will create a release PR which collects all changes that have been merged since the last release
  4. This PR can be merged at any point to then create a new main release

Creating a snapshot (development) release

  1. Push your desired changes to a new branch (do not forget to add a changeset - see above)
  2. Use the "Release a snapshot" action under "Actions" image
  3. Pick your branch that you would like to release a snapshot from image
  4. The snapshot release will be available in npm under 0.0.0-next-TIMESTAMP or @snapshot

Contributing

All contributions are welcome. Please read the Contributing Guidelines and review our Code of Conduct before submitting a PR.

License

GPL-3.0

colonyjs's People

Contributors

0xjjpa avatar alicjakujawa avatar area avatar armandograterol avatar ceolson01 avatar chinins avatar chmanie avatar collinvine avatar coyotespike avatar danbr avatar dependabot[bot] avatar fallafeljan avatar gichiba avatar github-actions[bot] avatar greenkeeper[bot] avatar gtarsia avatar igorline avatar jakubcolony avatar jameslefrere avatar kronosapiens avatar lightnode avatar proofoftom avatar rdig avatar ryanchristo avatar split-infinity avatar sprusr avatar thiagodelgado111 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colonyjs's Issues

Extended Colony Protocol

Story: as a developer I'd like to have an easy way to store data which is immutable and connected to a task as well as essential for the task lifecycle to be represented correctly.

A feature of the ColonyJS client will be what @lsenta dubbed "The Extended Colony Protocol". These are interactions with data that does not live on the blockchain but is crucial for the whole task workflow (and other Colony functionality) to be usable. In any implementation of Colony this data is a hard requirement.

This data contains (but is not necessarily limited to):

  • Task
    • Task brief (specification)
    • Task deliverable
  • Domain names (they just have an id)
  • Skill names (?)

The reason for that is that we want to make it as easy as possible for developers to actually use the Colony workflow without worrying too much about this data and how it should be implemented. Another benefit here would be that we could extend the protocol easily by having the ability to store arbitrary data as a task specification. We could even give developers the opportunity to have own fields in the task brief that can be more complex than just a simple text (JSON documents).

This data in regard of a task has to be strongly differentiated from task metadata which is not required to actually work on the task but provides information for an UI for example (column, position of a task in that column). These are irrelevant for the actual task brief and can be changed at any time without the assignee having to confirm.

To be flexible in the actual implementation we imagined this to be pluggable as well. An obvious choice would be a storage connector for IPFS. We are using IPFS in the dApp anyways, so this might be the first connector we offer.

Other choices for connectors might include:

  • Ethereum Swarm
  • Other decentralised DB solutions like wolk, fluence

Open questions:

  • Do we want to allow developers to add arbitrary data to a task which is required for a brief in their implementation?
  • Are skill names stored on the blockchain?
  • What are subtasks? Do they provide additional information that might change the brief?
  • Can we imagine people wanting to use a centralised service which is not trustless for storing this data instead of for example IPFS (like a mongoDB storage, graphQL storage)?
  • What about comments?

Release colonyJS

Let's do this!

Once the TODO list is there, we can press the button:

  • Rename to colonyJS

  • Fix Circle CI webhooks (James)

  • Review and merge #97

  • Review and merge #98

  • Align and update all Readme files in packages of colonyJS (James)

  • Create CONTRIBUTING.md (Griffin)

  • Update quickstart docs (outdated) (James)

  • Review and merge #101

  • Review and merge #96

  • Review and merge #105

  • #94

  • Update loaders docs

    • Remove yarn add @colony/colony-js-contract-loader from loaders
    • TODOs in loader doc
    • parser -> transform
  • Update adapters docs

    • Remove Adapters API document
    • Remove “Loading a contract” and “Interacting with a contract” from Docs_Adapters
    • Rather show how the adapter is passed into the ColonyNetworkClient as an argument for example
    • Remove “Usage with web3” (the web3 adapter isn’t done yet)
    • Remove web3 adatper link
  • Update contract client docs

    • missing examples
    • missing MultiSig description
    • links aren’t working
    • ContractResponse
    • MultiSigOperation
  • Multisig page

  • Make changes suggested by @coyotespike 👇

  • Add colonyNetwork get started page (how to setup a simple dev environment with truffle, ganache-cli and trufflepig to compile, deploy and serve the contracts)

  • document functions of ColonyClient and ColonyNetwork client that are not documented in flow (that are not callers, senders or multisig)

  • Take care of the inconsistency here:
    https___joincolony_github_io_colonyjs__and_https___joincolony_github_io_colonynetwork__and_slack_-_colony

  • Create joincolony.github.io index page because currently it looks like this
    image

  • Create CHANGELOG.md #88

  • Make the repo public

  • Publish on npm

Simple token creation

As a new user I want the option to create a token directly when creating a Colony, so that I don't have to bring my own token.

Web3 adapter

As a developer using the colony-js library, I want the option to use web3, so that I can more easily use it with my web3-based project.

Suggestion: aim for the 1.0 version of web3, given its imminent release.

Client provides wrong / malformed transaction data

I came across this while testing the ColonyCreationTest component inside colonyDapp, but it seems like it's coming from colony-js-client, so I'm posting it here. (I was trying to the create a new token -- the first form)

The transaction data that's being passed to ethers Walletss sendTransaction() method is malformed, so it crashes the client. (I am accessing the createToken() method from the client)

This sends the transaction data as a string: (Example from my tests)

0x6060604052341561000f57600080fd5b604051606080610b408339810160405261003290678000000000000000906100a0565b60018054600160a060020a03191633600160a060020a03169081179091557fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a26005929092556003556004556100f9565b600061009982516100f6565b9392505050565b6000806000606084860312600181146100b8576100bd565b600080fd5b5060006100ca868661008d565b93505060206100db8682870161008d565b92505060406100ec8682870161008d565b9150509250925092565b90565b610a38806101086000396000f3006060604052600436106100cf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100d4578063095ea7b3146100fd57806313af40351461012857806318160ddd1461014857806323b872dd1461015b578063313ce5671461017957806370a082311461018c5780637a9e5e4b146101aa5780638da5cb5b146101c857806395d89b41146101e8578063a0712d68146101fb578063a9059cbb14610219578063bf7e214f14610237578063dd62ed3e14610257575b600080fd5b34156100df57600080fd5b6100e7610275565b6040516100f491906109b6565b60405180910390f35b341561010857600080fd5b61011b6101163660046108d6565b61027b565b6040516100f491906109a8565b341561013357600080fd5b61014661014136600461082c565b6102ec565b005b341561015357600080fd5b6100e761036b565b341561016657600080fd5b61011b61017436600461088a565b610371565b341561018457600080fd5b6100e76104cb565b341561019757600080fd5b6100e76101a536600461082c565b6104d1565b34156101b557600080fd5b6101466101c3366004610905565b6104ec565b34156101d357600080fd5b6101db61056b565b6040516100f49190610972565b34156101f357600080fd5b6100e761057a565b341561020657600080fd5b610146610214366004610922565b610580565b341561022457600080fd5b61011b6102323660046108d6565b6105f0565b341561024257600080fd5b61024a6106b9565b6040516100f491906109c4565b341561026257600080fd5b6100e7610270366004610851565b6106c8565b60055481565b600160a060020a03338116600081815260086020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925908590516102da91906109b6565b60405180910390a35060015b92915050565b61030233600035600160e060020a0319166106f3565b151561030d57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b60065490565b600160a060020a0383166000908152600760205260408120548290101561039457fe5b600160a060020a0380851660009081526008602090815260408083203390941683529290522054829010156103c557fe5b600160a060020a03808516600090815260086020908152604080832033909416835292905220546103f690836107e1565b600160a060020a03808616600081815260086020908152604080832033909516835293815283822094909455908152600790925290205461043790836107e1565b600160a060020a03808616600090815260076020526040808220939093559085168152205461046690836107f1565b600160a060020a03808516600081815260076020526040908190209390935591908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908590516104b991906109b6565b60405180910390a35060019392505050565b60045481565b600160a060020a031660009081526007602052604090205490565b61050233600035600160e060020a0319166106f3565b151561050d57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600154600160a060020a031681565b60035481565b61059633600035600160e060020a0319166106f3565b15156105a157600080fd5b600160a060020a0333166000908152600760205260409020546105c490826107f1565b600160a060020a0333166000908152600760205260409020556006546105ea90826107f1565b60065550565b600160a060020a0333166000908152600760205260408120548290101561061357fe5b600160a060020a03331660009081526007602052604090205461063690836107e1565b600160a060020a03338116600090815260076020526040808220939093559085168152205461066590836107f1565b600160a060020a0380851660008181526007602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908590516102da91906109b6565b600054600160a060020a031681565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b600030600160a060020a031683600160a060020a03161415610717575060016102e6565b600154600160a060020a0384811691161415610735575060016102e6565b600054600160a060020a0316151561074f575060006102e6565b60008054600160a060020a03169063b700961390859030908690604051602001526040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016107aa93929190610980565b602060405180830381600087803b15156107c357600080fd5b5af115156107d057600080fd5b5050506040518051905090506102e6565b808203828111156102e657600080fd5b808201828110156102e657600080fd5b600061080d82356109d2565b9392505050565b600061080d82356109f3565b600061080d82356109e3565b6000602082840312600181146100cf575060006108498484610801565b949350505050565b600080604083850312600181146100cf5750600061086f8585610801565b925050602061088085828601610801565b9150509250929050565b6000806000606084860312600181146100cf575060006108aa8686610801565b93505060206108bb86828701610801565b92505060406108cc86828701610820565b9150509250925092565b600080604083850312600181146100cf575060006108f48585610801565b925050602061088085828601610820565b6000602082840312600181146100cf575060006108498484610814565b6000602082840312600181146100cf575060006108498484610820565b610948816109d2565b82525050565b610948816109de565b610948816109e3565b610948816109e6565b610948816109f3565b602081016102e6828461093f565b6060810161098e828661093f565b61099b6020830185610969565b6108496040830184610960565b602081016102e6828461094e565b602081016102e68284610957565b602081016102e68284610969565b600160a060020a031690565b151590565b90565b600160e060020a03191690565b60006102e6826109d25600a265627a7a7230582024fd4d63e0d230c7d265625083b288e98803a23e10ccea9ac4a3932279dcdd616c6578706572696d656e74616cf500375261756c20436f696e000000000000000000000000000000000000000000000052434f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012

Where as the ethers.Wallet.sendTransaction() method expects an Object: https://github.com/ethers-io/ethers.js/blob/master/wallet/wallet.js#L244-L246

Here's a screenshot from my tests, with the error and values logged out:

screenshot from 2018-04-03 18-46-09

Make failing tests pass (or skip/remove invalid tests)

Entire log as follows:

 yarn run test
yarn run v1.3.2
$ flow check && lerna run test
Found 0 errors
lerna info version 2.5.1
lerna info versioning independent

> @colony/[email protected] test /Users/james/colony/colony-js/packages/colony-js-adapter
> echo 'Error: no test specified'

Error: no test specified
lerna ERR! test Errored while running script in '@colony/colony-js-client'
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: npm run test
lerna ERR! error Command failed with exit code 1.
lerna ERR! npm ERR! code ELIFECYCLE
lerna ERR! npm ERR! errno 1
lerna ERR! npm ERR! @colony/[email protected] test: `yarn run lint && yarn run test:unit`
lerna ERR! npm ERR! Exit status 1
lerna ERR! npm ERR!
lerna ERR! npm ERR! Failed at the @colony/[email protected] test script.
lerna ERR! npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
lerna ERR!
lerna ERR! npm ERR! A complete log of this run can be found in:
lerna ERR! npm ERR!     /Users/james/.npm/_logs/2018-01-11T14_05_57_817Z-debug.log
lerna ERR!
lerna ERR! > @colony/[email protected] test /Users/james/colony/colony-js/packages/colony-js-client
lerna ERR! > yarn run lint && yarn run test:unit
lerna ERR!
lerna ERR! $ eslint src
lerna ERR!
lerna ERR! /Users/james/colony/colony-js/packages/colony-js-client/src/__tests__/Contract.test.js
lerna ERR!   24:12  error  Unexpected dangling '_' in '_adapter'  no-underscore-dangle
lerna ERR!
lerna ERR! /Users/james/colony/colony-js/packages/colony-js-client/src/index.js
lerna ERR!    1:10  error  Prefer default export                import/prefer-default-export
lerna ERR!   13:1   error  More than 2 blank lines not allowed  no-multiple-empty-lines
lerna ERR!
lerna ERR! ✖ 3 problems (3 errors, 0 warnings)
lerna ERR!   1 error, 0 warnings potentially fixable with the `--fix` option.
lerna ERR!
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR!
lerna ERR!     at Promise.all.then.arr (/Users/james/colony/colony-js/node_modules/execa/index.js:236:11)
lerna ERR!     at <anonymous>
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.

> @colony/[email protected] test /Users/james/colony/colony-js/packages/colony-js-adapter-ethers
> yarn run lint && yarn run test:unit

$ eslint src
$ jest --coverage --config=jest.conf.json
------------|----------|----------|----------|----------|----------------|
File        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
------------|----------|----------|----------|----------|----------------|
All files   |      100 |      100 |      100 |      100 |                |
 Adapter.js |      100 |      100 |      100 |      100 |                |
 index.js   |      100 |      100 |      100 |      100 |                |
------------|----------|----------|----------|----------|----------------|
(node:31570) UnhandledPromiseRejectionWarning: Error: Command failed: npm run test
error Command failed with exit code 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @colony/[email protected] test: `yarn run lint && yarn run test:unit`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @colony/[email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/james/.npm/_logs/2018-01-11T14_05_57_817Z-debug.log

> @colony/[email protected] test /Users/james/colony/colony-js/packages/colony-js-client
> yarn run lint && yarn run test:unit

$ eslint src

/Users/james/colony/colony-js/packages/colony-js-client/src/__tests__/Contract.test.js
  24:12  error  Unexpected dangling '_' in '_adapter'  no-underscore-dangle

/Users/james/colony/colony-js/packages/colony-js-client/src/index.js
   1:10  error  Prefer default export                import/prefer-default-export
  13:1   error  More than 2 blank lines not allowed  no-multiple-empty-lines

✖ 3 problems (3 errors, 0 warnings)
  1 error, 0 warnings potentially fixable with the `--fix` option.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

    at Promise.all.then.arr (/Users/james/colony/colony-js/node_modules/execa/index.js:236:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
(node:31570) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:31570) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Rename `parser` to `transform`

In the loaders developers can define a function which is currently called parse. This function transforms the contract response so that it fits the desired format of { abi, address, bytecode }.

Hence I'd like to suggest to call it transform as it's not really parsing anything.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Add prettier 💅🙏

https://github.com/prettier/prettier

This should help us standardise the code formatting help keep things clean without any additional effort.

Recommendations:

  • Ensure it's compatible with all of our eslint rules (should be fine, worked for me before)
  • Ensure it's compatible with flow (should be fine, worked for me before)
  • Do a codemod commit over the whole js codebase
  • Set up a git hook so it runs on precommit
  • For developers: integrate it into your IDE, e.g. with a keyboard shortcut

Automatically generate API docs using CI and a template file

Let’s say colony-js gets updated. We put a placeholder into a template file in /docs (which is pretty much what we have right now except it doesn't contain the generated documentation and doesn’t begin with an underscore).

When building colony-js on the CI we

  1. Run the docgen
  2. Place the contents into the template file (where the placeholder is)
  3. Generate the underscored file from that
  4. Profit

Additionally add:

  • Types table in the Contract client docs (ColonyClient, ColonyNetworkClient)

Fix outdated methods used in Colony creation

#89 introduced a bug; ColonyNetworkClient.getColonyByAddress is still calling ColonyClient.createSelf, which has been removed.

There is also no test coverage for this method; add it if possible.

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Replaced the old Node.js version in your .nvmrc with the new one

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Change ContractClient initialisation method

Rather than calling a static function .create, we might want to change the API a bit. Developers should be able to create an instance of the ContractClient without awaiting it.

Proposal:

const colonyNetworkClient = new ColonyNetworkClient(adapter, { name: 'ColonyNetwork' });
await colonyNetworkClient.init();

And if people try to call a function on it without it being initialised, we throw an error.

Better handling for 'empty' responses

It's currently not clear when some Callers (e.g. ColonyClient.GetTask) contain an empty result. In these cases, perhaps use the incremental IDs to determine whether e.g. a task really exists (a taskId over the ColonyClient.getTaskCount result will not exist).

Make failed transactions more obvious

Currently failed transactions just have a different status property in the meta object. Consider an error, a console.warn, or other means of making it more obvious that the transaction failed.

API docs for ContractClient classes

Create documentation in the style of the other API docs (e.g. ColonyClient) for the ContractClient classes; ContractMethodCaller, ContractMethodSender, ContractMethodMultisigSender and MultisigOperation (ignoring the abstract class ContractMethod and ContractClient, as those tend not to be interacted with directly).

Upgrade lint-staged to version 7.x

I tried and it broke things. Apparently you can't run custom scripts anymore but you have to call npm scripts.

Changing it from

"lint --fix" to "yarn run lint --fix" broke other things, namely the package.jsons could not be parsed anymore:

lerna ERR! /Users/chris/dev/Colony/colony-js/packages/colony-js-contract-loader/package.json
lerna ERR! 2:11  error  Parsing error: Unexpected token, expected ";"
lerna ERR!
lerna ERR! 1 | {
lerna ERR! > 2 |     "name": "@colony/colony-js-contract-loader",
lerna ERR!   |           ^
lerna ERR! 3 |     "version": "1.0.0",
lerna ERR! 4 |     "description": "Contract loader interfaces",
lerna ERR! 5 |     "main": "index.js",
lerna ERR!
lerna ERR! ✖ 1 problem (1 error, 0 warnings)

I think that eslint tries to lint .json files which is quite strange.

Loader interface is too specific

The loader interface is a bit too specific as it states the endpoint as one of the ConstructorArgs. Though the endpoint is just used for the http-loader. Other loaders might have different arguments.

Also, we might want to think about whether all the loaders have to implement a parser argument.

Investigate missing address in ContractHttpLoader result

Under some circumstances (e.g. in colonyDapp) it seems that with ContractHTTPLoader, in the returning object of .load(), it doesn't give an address prop (the contract's address) and this makes EtherAdapter complain and fail.

Using ContractHttpLoader doesn't set an address prop at all, while using TrufflepigLoader, yields an address` prop, but it's set to undefined.

Investigate why greenkeeper is off here

Two problems:

  • Greenkeeper doesn't add subsequent updates to the PR branch (e.g. when two updates happen in the meantime the PR is open)
  • Greenkeeper doesn't update the lockfile

HTTPContractLoader needs to interpolate the address as well in the endpoint

When using for example the etherscan API the contracts are just defined by address (e.g. https://api.etherscan.io/api?module=contract&action=getabi&address=0x06012c8cf97bead5deae237070f9587f8e7a266d). Currently we only interpolate the %%NAME%% and %%VERSION% variables. To that we need to add the address as %%ADDRESS%% to be able to use it properly with the etherscan API (most not-upgradable contracts will work that way).

Contract Loading

Create contract loaders (ideally an official Colony Network contract loader and a development loader). The loader will be called from the colony-js client.

As a contract loader, my job is to:

  • Provide an ABI manifest and contract address for deployed Colony contracts, given simple parameters (e.g. name of contract and version)

I am "finished" when:

  • I provide a simple API to load the API/contract address
  • I have an official loader and a dev loader
  • I am open-sourced on Github and published on NPM
  • I have clear documentation/best practice guide

Add etherscan parser to HTTPContractLoader

I think the format slightly differs from the truffle one. Also we might want to pass the loader's Options through to the parser like so:

export type Options = {
  address?: string,
  router?: string,
  version?: string,
  networkId?: number,
};

export type ContractDefinition = {
  abi: Object, // THIS IS ALSO A PROPOSED CHANGE
  address: string,
  bytecode?: string, // THIS IS ALSO A PROPOSED CHANGE
};

export type Parser = (input: any, options?: Options) => ContractDefinition;

While we're at it I think we can make the abi an Object in the ContractDefinition. Another thing: can we make the bytecode optional?

Transaction event listener API

Use case: As a developer, I want to subscribe to transactions happening in a Colony, so that I can respond to changes in real time.

In order to build some services on top of the Colony JS client (e.g. Github integration), we need to be able to subscribe to changes that happen in a Colony, without having to rely on regular contract events alone. For example, if someone calls ColonyClient.submitTaskDeliverable, there's currently no means on the client to see that this has happened, and that the transaction was successful. If we have an event listener-based API (perhaps for every Sender), then we should be able to do this easily.

A suggestion for the API:

// Wait for a transaction to be mined (from anyone)!
client.on(
  'submitTaskDeliverable',
  ({ transaction, params }) => {
    console.log(
      `${transaction.from} added a deliverable to a Task (ID ${params.taskId}): ${params.deliverableHash}`,
    );
  }
);

The underlying adapter should offer some means of subscribing to the transactions and emitting an event when they are mined. It might also be quite useful to decode the parameters the contract function was called with, and pass them through the ContractMethod they relate to, such that we receive them as an object with named properties (e.g. { taskId: 1, deliverableHash: '0x123' }).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.