All Projects → JoinColony → Colonyjs

JoinColony / Colonyjs

Licence: gpl-3.0
The Colony JavaScript client

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Colonyjs

Cryptolist
Curated collection of blockchain & cryptocurrency resources.
Stars: ✭ 3,501 (+4762.5%)
Mutual labels:  api, blockchain, ethereum
Exchangesharp
ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.
Stars: ✭ 489 (+579.17%)
Mutual labels:  api, blockchain, ethereum
Ethql
A GraphQL interface to Ethereum 🔥
Stars: ✭ 547 (+659.72%)
Mutual labels:  api, blockchain, ethereum
Udacity Blockchain Developer Nanodegree
The road so far on Udacity Blockchain Developer Nanodegree
Stars: ✭ 53 (-26.39%)
Mutual labels:  blockchain, ethereum
Blockchainage
「区块链技术指北」相关资料。
Stars: ✭ 51 (-29.17%)
Mutual labels:  blockchain, ethereum
Remix
This has been moved to https://github.com/ethereum/remix-project
Stars: ✭ 1,063 (+1376.39%)
Mutual labels:  blockchain, ethereum
Learn Solidity
Code base for "Learn Solidity: Programming Language for Ethereum Smart Contracts" course in Tosh Academy & Blockchain Council
Stars: ✭ 44 (-38.89%)
Mutual labels:  blockchain, ethereum
Kubereum
Kubernetes + Ethereum = Kubereum!!!
Stars: ✭ 55 (-23.61%)
Mutual labels:  blockchain, ethereum
Awesome Ethereum Cn
Web3.js、Solidity、Truffle开发教程及以太坊开发资源汇总
Stars: ✭ 54 (-25%)
Mutual labels:  blockchain, ethereum
Etherscan Ml
Python Data Science and Machine Learning Library for the Ethereum and ERC-20 Blockchain
Stars: ✭ 55 (-23.61%)
Mutual labels:  blockchain, ethereum
Shitaibin.github.io
博客:Go语言、区块链
Stars: ✭ 59 (-18.06%)
Mutual labels:  blockchain, ethereum
Tokensale
Tokensale Best Practices for Founders
Stars: ✭ 50 (-30.56%)
Mutual labels:  blockchain, ethereum
Ethereumbook
Mastering Ethereum, by Andreas M. Antonopoulos, Gavin Wood
Stars: ✭ 11,663 (+16098.61%)
Mutual labels:  blockchain, ethereum
Trace
Supply chain transparency platform proof-of-concept based on the Ethereum blockchain ✍️
Stars: ✭ 52 (-27.78%)
Mutual labels:  blockchain, ethereum
Ethdroid
Easy-to-use Ethereum Geth wrapper for Android
Stars: ✭ 47 (-34.72%)
Mutual labels:  blockchain, ethereum
Cryptolights
Live visualisation of blockchain transactions for popular cryptocurrencies
Stars: ✭ 54 (-25%)
Mutual labels:  blockchain, ethereum
Zknifty
🎴Zero-knowledge non-fungible tokens on Ethereum using zk-SNARKs
Stars: ✭ 59 (-18.06%)
Mutual labels:  blockchain, ethereum
The Journal Of Blockchain
区块链自媒体、专注区块链技术学习和实践、IPFS/Filecoin、Bitcoin、Ethereum、EOS、Cosmos、区块链、白皮书、Coinmarketcap、Coindesk、Safe Network、Telegram、Docker、社会治理、经济激励
Stars: ✭ 63 (-12.5%)
Mutual labels:  blockchain, ethereum
Minimal
Modular Ethereum client
Stars: ✭ 69 (-4.17%)
Mutual labels:  blockchain, ethereum
Zerodollarhomepage
A decentralized ad server running on the blockchain
Stars: ✭ 43 (-40.28%)
Mutual labels:  blockchain, ethereum

colonyJS

colonyJS is a JavaScript library with a simple and predictable interface for application-layer integrations with the colonyNetwork smart contracts. To learn more about Colony, you can visit colony.io or read the White Paper.

This software is in ALPHA state. The API is subject to change (but shouldn't really).

Documentation

The documentation is automatically generated using TypeDoc. It's pretty alpha right now. You should check out the getColonyNetworkClient function in ColonyNetworkClient and the docs for the extended colony contracts clients/Colony/ColonyClientVX.

Get Started

import { getColonyNetworkClient, Network } = from '@colony/colony-js';
import { Wallet } from 'ethers';
import { JsonRpcProvider } from 'ethers/providers';

// For local connections (run an Ethereum node on port 8545);
const provider = new JsonRpcProvider();

// Put in your local network address here (deployed ether router address)
const networkAddress = '0xdabbad00';

(async () => {
  // Get a wallet instance
  const wallet = new Wallet(
    // This is a private key that is generated by the colony network ganache instance
    '0x0355596cdb5e5242ad082c4fe3f8bbe48c9dba843fe1f99dd8272f487e70efae',
    provider,
  );

  // Check out the logs to see the wallet address
  console.log('Wallet Address:', wallet.address);

  // Get a network client instance
  const networkClient = await getColonyNetworkClient(
    Network.Local,
    wallet,
    // The address of the locally deployed EtherRouter!
    { networkAddress: '0xdabbad00' }
  );

  // Check out the logs to see the network address
  console.log('Network Address:', networkClient.address);

  // Get the colony client for the Meta Colony
  const colonyClient = await networkClient.getColonyClient(1);

  console.log('Meta Colony address:', colonyClient.address);
})()
  .then(() => process.exit())
  .catch(error => console.error(error));

Contributing

We welcome all contributions to colonyJS! See Contributing for more information.

Development

Local development

Using just npm you can link the built colonyJS files to your Dapp when developing new features in colonyJS while trying them out immediately in your dev-environment.

To do that:

  1. Make sure you are using the exact same node version in colonyJS and the Dapp. Use nvm if possible

  2. Update the required submodules:

git submodule update --init --recursive
  1. Build colonyJS. In the colonyJS directory do:
npm run build
  1. Create an npm link in the colonyJS directory:
npm link
  1. Link to it in the Dapp directory:
npm link @colony/colony-js
  1. Then do a regular install in the Dapp directory:
npm install

To overwrite the link again just specify a version that exists on npm:

npm install @colony/[email protected]^3.0.0

If that doesn't remove it, just remove the folder in node_modules

To release a new version

  1. First, commit all your changes. Then run the tests:
npm test #just to be sure
  1. Adjust the version in package.json

  2. Let npm adjust the version in package-lock.json:

npm install
  1. Commit the npm package files. Use the version set in the package.json (make sure to follow the version pattern):
git add pack*
git commit -m '2.0.1' # no `v`!
  1. Tag the commit:
git tag v2.0.1 # here we use the `v`!
  1. Push the changes and tags:
git push && git push --tags
  1. Publish on npm:
npm publish --access=public

Done 🎊

To upgrade to a new colonyNetwork version

  1. Add the version to constants.ts in ColonyVersion
  2. Change the CurrentVersion variable to the one you just added
  3. Add the git tag to src/constants.ts release map
  4. Optional: If you are tracking a development branch instead of a static tag or commit, make sure to pull the latest changes, otherwise the contracts generated will be exactly the same as your last ones -- this is a step often forgotten when using a dev version
  5. If needed: add new contracts that need clients to the contractsToBuild array in scripts/build-contracts.ts
  6. Run
DISABLE_DOCKER=true npm run build-contracts -- -V=X

where X is the version number you just added (the incremental integer of the ColonyVersion enum).

This will create a new folder: src/contracts/X containing all the type definitions you'll need to implement the new colony client.

  1. Update the following lines in ColonyNetworkClient.ts to reflect the new version:
import { IColonyNetworkFactory } from '../contracts/X/IColonyNetworkFactory';
import { IColonyNetwork } from '../contracts/X/IColonyNetwork';
  1. Update all the other contract imports in the non-colony clients, even if they haven't been upgraded (just in case). Then make adjustments to the clients to reflect the contract changes (typescript will tell you, where to make changes). Also add necessary helper functions (e.g. withProofs functions) for newly added methods. The newly added methods and their required roles can be found in this file (and by diffing the generated interface files).

License

GPL-3.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].