Skip to content

Commit c920091

Browse files
Merge pull request #156 from transfer-agent-protocol/dev
improvement(docs) - update readme, add slightly better logging
2 parents cfd8159 + 643cd3f commit c920091

File tree

4 files changed

+30
-106
lines changed

4 files changed

+30
-106
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ ETHERSCAN_L2_API_KEY=UPDATE_ME
1717
ETHERSCAN_L1_API_KEY=UPDATE_ME
1818

1919
# Server port
20-
PORT=8080
20+
PORT=8293
2121

README.md

Lines changed: 9 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,25 @@
1-
# Transfer Agent Protocol, Specification for a compliant cap table onchain [TAP](https://transferagentprotocol.xyz)
2-
3-
Developed by:
4-
5-
# [Transfer Agent Protocol](https://transferagentprotocol.xyz/)
6-
7-
- [Poet](https://poet.network/)
8-
- [Plural Energy](https://www.pluralenergy.co/)
9-
- [Fairmint](https://www.fairmint.com/)
10-
11-
This repo is based on the [Open Cap Table Coalition](https://github.com/Open-Cap-Table-Coalition/Open-Cap-Format-OCF) standard, with the license included in its entirety. In development, it's meant to be run in a Docker container with a local MongoDB instance. While in active development, it's meant to be run with [Anvil](https://book.getfoundry.sh/anvil/) and [Forge](https://book.getfoundry.sh/forge/).
12-
131
<div align="center">
142
<a href="https://github.com/transfer-agent-protocol/tap-cap-table/blob/main/LICENSE">
153
<img alt="License" src="https://img.shields.io/github/license/transfer-agent-protocol/tap-cap-table">
164
</a>
175
</div>
186

19-
## Dependencies
20-
21-
- [Docker](https://docs.docker.com/get-docker/)
22-
23-
- [Foundry](https://getfoundry.sh/)
24-
25-
```sh
26-
curl -L https://foundry.paradigm.xyz | bash
27-
```
28-
29-
- [Mongo Compass](https://www.mongodb.com/try/download/compass)
30-
31-
- [Postman App](https://www.postman.com/downloads/)
32-
33-
- [Node.js v18.16.0](https://nodejs.org/en/download/)
34-
35-
- [Yarn v1.22.19](https://classic.yarnpkg.com/en/docs/install/#mac-stable)
36-
37-
We're using the official [MongoDB Docker image](https://hub.docker.com/_/mongo) for the local development database. You can find the [Docker Compose file](./docker-compose.yml) in the root of this repository.
38-
39-
## Official links
40-
41-
- [Contributor doc](https://coda.io/d/_dFoHg0h07Et/Transfer-Agent-Protocol_sua17) - to read about the project and how to contribute.
42-
- [Slack](https://transferagentprotocol.slack.com/) - invite only for now.
43-
44-
## Getting started
45-
46-
Ensure you have all dependencies setup. Clone the repository with OCF and Forge included as submodules:
47-
48-
```sh
49-
git clone --recurse-submodules https://github.com/poet-network/tap-cap-table.git
50-
```
51-
52-
## Initial setup
53-
54-
Our `.env.example` files are setup for local development with Docker and Foundry. You'll need to copy them to `.env` and update the values with your own. If you're a contributor working with us, you will get those values from our Bitwarden vault.
55-
56-
Copy `.env.example` to `.env` in the root of the project.
57-
58-
```sh
59-
cd tap-cap-table && cp .env.example .env
60-
```
61-
62-
In the root folder, pull the official Mongo image, and run the local development database with `docker compose`:
7+
# Documentation
638

64-
```sh
65-
docker compose up
66-
```
67-
68-
## Running Anvil
69-
70-
This repo is onchain first. We use [Anvil](https://book.getfoundry.sh/anvil/) to run the local blockchain and deploy our cap table smart contracts. At all times, you should have Anvil running alongside Docker and nodemon.
71-
72-
With the mongo DB running on Docker you can start Anvil.
73-
74-
In the `/chain` directory, run:
75-
76-
```sh
77-
anvil
78-
```
79-
80-
Install dependencies and setup [Foundry](https://book.getfoundry.sh/) and `forge` with our setup script:
81-
82-
```sh
83-
yarn install && yarn setup
84-
```
85-
86-
## Deploying the cap table smart contracts
87-
88-
In our architecture, each transaction is mapped to an external library, which ensures bytecode limits are never met. To deploy these libraries:
9+
Read official docs at [https://docs.transferagentprotocol.xyz](https://docs.transferagentprotocol.xyz/) to get started.
8910

90-
1. Ensure you have Anvil running in the `/chain` directory
91-
2. Then, inside of the root directory run
11+
This repo is based on the [Open Cap Table Coalition](https://github.com/Open-Cap-Table-Coalition/Open-Cap-Format-OCF) standard, with the license included in its entirety.
9212

93-
```sh
94-
yarn deploy-libraries
95-
```
13+
## Contributing
9614

97-
This will build all libraries and will take at least 5 minutes to complete. Each library is being deployed one at a time using a dependency graph that's generated with the command.
15+
We welcome all contributions. Please give a quick read to our [CONTRIBUTING](./CONTRIBUTING.md) guidelines to understand the them and the process.
9816

99-
```sh
100-
yarn deploy-factory [.env file to use]
101-
```
17+
## License
10218

103-
This will deploy the factory as pointed to in the `.env` or the file you pass in, such as .env.local
19+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
10420

21+
## OUTDATED README BELOW
22+
---
10523
## Running the cap table server
10624

10725
After the deployment script is completed, start the server with nodemon:
@@ -189,11 +107,3 @@ Integration test setup from no active processes:
189107
- In MongoDB compass, create/update `implementation_address` and `factory_address` in `jest-integration.factories`
190108
- If the `jest-integration` MongoDB databases dont exist: `cd .. && yarn test-js-integration`
191109
- Run `yarn test-js-integration`!
192-
193-
## Contributing
194-
195-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to contribute to this project.
196-
197-
## License
198-
199-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

src/app.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,24 @@ export const startServer = async (finalizedOnly) => {
7373
// Connect to MongoDB
7474
const dbConn = await connectDB();
7575

76-
const server = app.listen(PORT, async () => {
77-
console.log(`🚀 Server successfully launched at ${PORT}`);
78-
// Asynchronous job to track web3 events in web2
79-
startEventProcessing(finalizedOnly, dbConn);
76+
const server = app
77+
.listen(PORT, async () => {
78+
console.log(`🚀 Server successfully launched at ${PORT}`);
79+
// Asynchronous job to track web3 events in web2
80+
startEventProcessing(finalizedOnly, dbConn);
81+
})
82+
.on("error", (err) => {
83+
if (err.code === "EADDRINUSE") {
84+
console.log(`Port ${PORT} is already in use.`);
85+
} else {
86+
console.log(err);
87+
}
88+
});
89+
90+
server.on("listening", () => {
91+
const address = server.address();
92+
const bind = typeof address === "string" ? "pipe " + address : "port " + address.port;
93+
console.log("Listening on " + bind);
8094
});
8195

8296
return server;

src/scripts/sampleData.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const issuer = {
2-
legal_name: "Banana Peppers Inc.",
2+
legal_name: "Transfer Agent Protocol",
33
formation_date: "2022-08-23",
44
country_of_formation: "US",
55
country_subdivision_of_formation: "DE",
@@ -10,7 +10,7 @@ export const issuer = {
1010
},
1111
],
1212
email: {
13-
email_address: "concierge@poet.network",
13+
email_address: "alex@transferagentprotocol.xyz",
1414
email_type: "BUSINESS",
1515
},
1616
initial_shares_authorized: "10000000",

0 commit comments

Comments
 (0)