Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme and truffle config updates #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,21 @@ migrate

## Connect to Kaleido

1. In Kaleido, select the node you want to connect to, then choose `+ Connect Node`.
1. In the Kaleido console, navigate to your environment, click on **Security** in the left hand navigation menu, then click on **App Creds**

2. Select `Native JSON/RPC`
2. Click **New App Cred** and give it a name and click **Create**. Do not close this window until we have completed the steps below

3. Choose an application credential to use for this connection.
3. Navigate to where you downloaded the Kaleido Truffle Box in the section above. Open up the truffle-config.js file in your preferred IDE

4. Choose the `Truffle Suite` connection type.
4. Back in the Kaleido console, copy the JSON/RPC HTTP endpoint with valid App Creds that's generated in the right hand menu.

5. Copy the connection info from this panel into the respective variables inside of `truffle-config.js`. If you are using Quorum in this environment, ensure to uncomment the `type: "quorum"` property on your network object.
5. Paste this full URL into Line 9 where you see 'nodeConnectionURL'. Make sure to keep the URL that you insert inside quotation marks

```
const appCred = 'yourappcred';
const connectionURL = 'nodeConnectionURL';
```
```
type: 'quorum' // Use this property for Quorum environments
```

6. Migrate your contracts to your Kaleido chain!

```
truffle migrate
```
6. If you are using Quorum in this environment, ensure to uncomment the `type: "quorum"` property on your network object.

## Connect MetaMask to your Kaleido Chain

1. In the `Networks` switcher in MetaMask, choose `Custom RPC`.

2. Find the `New Network` section, and click `Advanced Options`. Add the `MetaMask RPC URL` from the connect panel, and give your network a nickname.
Detailed instructions to connect your Kaleido network to Metamask can be found [here](https://docs.kaleido.io/developers/smart-contracts/metamask/)

## Start Your React App

Expand Down
7 changes: 2 additions & 5 deletions truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ const path = require("path");
var Web3 = require('web3');

module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "app/src/contracts"),
networks: {
development: {
provider: () => {
const appCred = 'yourappcred'; // from application credential widget
const connectionURL = 'nodeConnectionURL'; // without protocol (https://)
return new Web3.providers.HttpProvider(`https://${appCred}@${connectionURL}`, 100000);
const connectionURL = 'nodeConnectionURL'; // replace nodeConnectionURL with JSON/RPC URL with valid App Creds
return new Web3.providers.HttpProvider({connectionURL}, 100000);
},
network_id: "*", // Match any network id
gasPrice: 0,
Expand Down